#include <scdl/parser/Symbol.hpp>

#include <cstdlib>
#include <cstring>
#include <iostream>

using std::cout;
using namespace scdl;

NamedSymbol::NamedSymbol()
        : name(0)
{
}

NamedSymbol::~NamedSymbol()
{
        if (name)
                free(name);
}

void NamedSymbol::prettyPrint(bool verbose)
{
        cout << name;
}

void NamedSymbol::setName(const char *newname)
{
        if (name)
                free(name);

        name = strdup(newname);
}

const char *NamedSymbol::getName()
{
        return name;
}